chrome.extension.onRequest.addListener((request, sender, sendResponse) => {
  switch (request.type) {
    case "createNewTab":
      createNewTab(request, sender, sendResponse);
      break;
  }
})

// 通过插件创建新的标签
function createNewTab(request, sender, sendResponse) {
  let properties = request.properties
  chrome.tabs.create(properties, tabInfo => {
      sendResponse(tabInfo)
  })
}